const models = require('../models')

models.ScanLog.findAll({
    include: [
        { model: models.QRCode, as: 'qrcode' },
        { model: models.Device, as: 'device', where: [{ 'type': 2 }, { 'hospitalId': 2 }, { 'departmentId': 2 }] },
    ]

    // include: [{ all: true }]
}).then(data => {
    console.log(data.length)
})